<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>

<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->

<head>
<script type="text/javascript">
function resend(regid){
	$('#id').val(regid);
	clicksubmit('_eventId_resend');
}
function clicksubmit(inputname){
	$("input[name="+inputname+"]").click();
}
</script>
</head>
<body>
<sf:form method="post" modelAttribute="registerFilter">
	<input type="submit" name="_eventId_registration" value="Session Report"/>
	<input type="submit" name="_eventId_excel" value="Save as Excel"/>
	<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}" />
	<sf:hidden path="id"/>
	<sf:hidden path="participantId"/>
	<div style="display: none;">
		<input type="submit" name="_eventId_resend" value="resend"/>
	</div>
<h2>Learning Journey Report</h2>
<table border="1"><tbody>
<tr>
	<th>Reg Id</th>
	<th>Register Date</th>
	<th>Updated Date</th>
	<th>Salutation</th>
	<th>Name</th>
	<th>NRIC</th>
	<th>Designation</th>
	<th>Organization</th>
	<th>Mobile</th>
	<th>Office No</th>
	<th>Email</th>
	<th>Address</th>
	<th>Postal Code</th>
	<th>LJ</th>
	<th>Amount</th>
	<th>Paypal payment status</th>
	<th>Paypal payer</th>
	<th></th>
</tr>
<c:forEach items="${registerList}" var="r" varStatus="rStatus">
<c:if test="${r.regType eq 1}"><tr>
	<td><c:out value="${r.id}"/></td>
	<td><fmt:formatDate value="${r.createdDate}" type="both"/></td>
	<td><fmt:formatDate value="${r.updatedDate}" type="both"/></td>
	<td><c:out value="${r.salutation}"/></td>
	<td><c:out value="${r.name}"/></td>
	<td><c:out value="${r.nric}"/></td>
	<td><c:out value="${r.designation}"/></td>
	<td><c:out value="${r.company}"/></td>
	<td><c:out value="${r.mobile}"/></td>
	<td><c:out value="${r.officeNo}"/></td>
	<td><c:out value="${r.email}"/></td>
	<td><c:out value="${r.address}"/></td>
	<td><c:out value="${r.postalCode}"/></td>
	<td><c:out value="${r.learningJourney}"/></td>
	<td><fmt:formatNumber type="currency" value="${r.amount}" currencySymbol="S$"/></td>
	<td><c:out value="${r.paymentStatus eq 1?'Success':''}"/></td>
	<td><c:out value="${r.payerEmail}"/></td>
	<td>
		<c:if test="${r.status eq 1}">
			<input type="button" value="Resend Email" onclick="javascript:resend(${r.id});"/>
		</c:if>
	</td>
</tr>
</c:if>
</c:forEach>
</tbody></table>
</sf:form>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.1.min.js"><\/script>')</script>
</body></html>